package com.bulls.demo.hrmsdemo.helper;

import java.math.BigDecimal;

import com.bulls.demo.hrmsdemo.db.Person;
import com.bulls.demo.hrmsdemo.form.SignupForm;

public class SignupHelper {
	
	public static void toDomainObject(SignupForm signupForm,Person person ){
		person.setPersonsk(signupForm.getPersonsk()!=null?Long.valueOf(signupForm.getPersonsk()):0);
		person.setFullname(signupForm.getFullname());
		person.setLastname(signupForm.getLastname());
		person.setGender(signupForm.getGender());
		person.setDob(null);
		person.setCountry(signupForm.getCountry());
		person.setState(signupForm.getState());
		person.setCity(signupForm.getCity());
		person.setAddressline1(signupForm.getAddressline1());
		person.setAddressline2(signupForm.getAddressline2());
		person.setEmailid(signupForm.getEmailid());
		person.setAlternateemailid(signupForm.getAlternateemailid());
		person.setLandlineno(signupForm.getLandlineno()!=null?new BigDecimal(signupForm.getLandlineno()):null);
		person.setMobileno(signupForm.getMobileno()!=null?new BigDecimal(signupForm.getMobileno()):null);
		person.setAlternatemobileno(signupForm.getAlternatemobileno()!=null?new BigDecimal(signupForm.getAlternatemobileno()):null);
		person.setZipcode(signupForm.getZipcode()!=null?new BigDecimal(signupForm.getZipcode()):null);
		person.setIsrrpresident(signupForm.getIsrrpresident());
		person.setRrpaddressline1(signupForm.getRrpaddressline1());
		person.setRrpaddressline2(signupForm.getRrpaddressline2());
		person.setPassword(signupForm.getPassword());
	}

}
